<?php

class Con_web extends Acan{
	
	public $defaultAct='index';
	public $Conread = '首页';
	public $Actread = array('index'=>'首页');
	function __construct($ainfo=null){
		parent::__construct($ainfo=null);
		$this->_S = Afun_session();
	}
	function Act_index(){
		$ass = Afun_new('weibo')->auth('web');
		//判断用户是否授权
		if (empty($_SESSION['token']["user_id"])) {//若没有获取到access token，则发起授权请求
			include $this->Atpl('web/auth');
			exit;
		} else {//若已获取到access token，则加载应用信息
			$this->_S = Afun_session();
			$auth = $this->_S['Auth'];
			$data->ss = $ass;
			if($auth['oid']>0){
				$data->Auth = $this->_S['Auth'];
				$data->msg = "登入成功";
			}else{
				$data->data = "登入失败";
				$data->msg = $this->_S;
			}
			$data = Ajson_encode($data);
		}
		include $this->Atpl();
	}
}

?>